/*
 * @Descripttion:
 * @version:
 * @Author: liyuhang
 * @Date: 2022-05-19 10:27:55
 */

Vue.component("myself-page", {
  template:
    '\
      <div class="wo">\
          <div class="a">\
            <p>{{getEmailName}}</p>\
            <p v-if=\'getEmailID=="null"\'></p>\
            <p v-else>{{getEmailID}}</p>\
          </div>\
          <div class="b">\
            <div>\
              <p @click="zhuce" class="input">配置内网邮箱</p>\
              <img src="../image/wode1.png" />\
            </div>\
            <div class="b_1">\
              <p @click="about" class="input">关于</p>\
              <img src="../image/wode1.png" />\
            </div>\
          </div>\
          <div class="c">\
          <img src="../image/wode.png" alt="" />\
        </div>\
        <div class="d">\
          <img src="../image/wode3.png" alt="" />\
        </div>\
        </div>\
          ',
  data() {
    return {
      getEmailID: sessionStorage.getItem("toMail"),
      getEmailName: "",
    }
  },
  created() {
    let newUserName
    let userNameString = sm2.doDecrypt(sessionStorage.getItem("userName"), sessionStorage.getItem("fprk"), 1)
    let userNameList = userNameString.split(",");
    if (sm3(userNameList[0]) == userNameList[1]) {
      newUserName = userNameList[0]
      this.getEmailName = newUserName
      if (isFlagOne) {
        this.getEmailName = noPassByName(this.getEmailName)
      } else {
        this.getEmailName = newUserName
      }
    }
  },
  methods: {
    zhuce() {
      if (this.getEmailID !== "null") {
        var btnArray = ["取消", "确定"];
        mui.confirm(
          "您已设置成功内网邮箱，确定要重置邮箱吗？",
          "消息提醒",
          btnArray,
          (e) => {
            if (e.index == 1) {
              $(location).attr("href", "zhu_ce.html");
            }
          }
        );
      } else {
        $(location).attr("href", "zhu_ce.html");
      }
    },
    about() {
      addOperator(4, 1, "关于", 1, 1, "跳转页面");
      $(location).attr("href", "about.html");
    },
    usageClick() {
      $(location).attr("href", "usageStatistics.html");
    },
  },
});
